package com.straw.hat.springboot.context.beanpostprocess;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.stereotype.Component;

/**
 * @author jianshan@byai.com
 * @date 2020/12/14 3:02 PM
 * describe:
 */
@Component
public class StrawHatBeanPostProcess implements BeanPostProcessor {

    private static final Logger LOGGER = LoggerFactory.getLogger(StrawHatBeanPostProcess.class);

    @Override
    public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
        LOGGER.info("Straw Hat BeanPostProcess postProcessBeforeInitialization");
        return bean;
    }

    @Override
    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
        LOGGER.info("Straw Hat BeanPostProcess postProcessAfterInitialization");
        return bean;
    }
}
